﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp5
{
    internal class Program
    {
        static void Main(string[] args)
        {
            List<int> num = new List<int>();

            num.Add(0);
            num.Add(1);
            num.Add(2);
            num.Add(3);
            num.Add(4);

            string strNum = "";

            for (int i = 0; i < num.Count; i++)
            {
                strNum += num[i];
                if (i < num.Count - 1)
                {
                    strNum += " ";
                }
            }
            Console.WriteLine(strNum);

            Console.WriteLine("----------");

            num.RemoveAt(4);

            strNum = "";

            for (int i = 0; i < num.Count; i++)
            {
                strNum += num[i];
                if (i < num.Count - 1)
                {
                    strNum += " ";
                }
            }
            Console.WriteLine(strNum);

            Console.WriteLine("----------");

            num[0] = 6;

            strNum = "";

            for (int i = 0; i < num.Count; i++)
            {
                strNum += num[i];
                if (i < num.Count - 1)
                {
                    strNum += " ";
                }
            }
            Console.WriteLine(strNum);

            Console.ReadKey();
        }
    }
}
